package com.huakang.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;

/**
 * operation
 * @author 
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Operation implements Serializable {
    private Integer opid;

    private String opname;
    @JsonFormat(pattern="yyyy-MM-dd")
    private Date opdate;

    private Integer pid;

    private Integer did;

    private static final long serialVersionUID = 1L;

    public Integer getOpid() {
        return opid;
    }

    public void setOpid(Integer opid) {
        this.opid = opid;
    }

    public String getOpname() {
        return opname;
    }

    public void setOpname(String opname) {
        this.opname = opname;
    }

    public Date getOpdate() {
        return opdate;
    }

    public void setOpdate(Date opdate) {
        this.opdate = opdate;
    }

    public Integer getPid() {
        return pid;
    }

    public void setPid(Integer pid) {
        this.pid = pid;
    }

    public Integer getDid() {
        return did;
    }

    public void setDid(Integer did) {
        this.did = did;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        Operation other = (Operation) that;
        return (this.getOpid() == null ? other.getOpid() == null : this.getOpid().equals(other.getOpid()))
            && (this.getOpname() == null ? other.getOpname() == null : this.getOpname().equals(other.getOpname()))
            && (this.getOpdate() == null ? other.getOpdate() == null : this.getOpdate().equals(other.getOpdate()))
            && (this.getPid() == null ? other.getPid() == null : this.getPid().equals(other.getPid()))
            && (this.getDid() == null ? other.getDid() == null : this.getDid().equals(other.getDid()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getOpid() == null) ? 0 : getOpid().hashCode());
        result = prime * result + ((getOpname() == null) ? 0 : getOpname().hashCode());
        result = prime * result + ((getOpdate() == null) ? 0 : getOpdate().hashCode());
        result = prime * result + ((getPid() == null) ? 0 : getPid().hashCode());
        result = prime * result + ((getDid() == null) ? 0 : getDid().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", opid=").append(opid);
        sb.append(", opname=").append(opname);
        sb.append(", opdate=").append(opdate);
        sb.append(", pid=").append(pid);
        sb.append(", did=").append(did);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}